home *** CD-ROM | disk | FTP | other *** search
- (******************)
- (******************)
- Program BBSLIST;
- (******************)
- (******************)
-
- Uses DOS,CRT;
-
- Const
- PathLength = 65;
- Line = '░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓██████████████████▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒░░░░░░░░░';
- BBSLine = 'Name Phone Soft Baud R G F A';
-
- Type
- FileName = String[PathLength];
-
- Var
- InFileName,CfgFileName,
- BBSFileName,OutFileName : FileName;
-
- InFile,CfgFile,BBSFile,
- TxtFile : Text;
-
- TmpStr,BBSName : String;
-
- LineClr,NameClr,FlagClr,
- TitleClr,FstClr,AltClr : String[4];
-
- I : Integer;
-
- (******************)
- Procedure CONFIG;
-
- Begin
- TmpStr := ' ';
- LineClr := '@00@';
- NameClr := '@00@';
- FlagClr := '@00@';
- TitleClr := '@00@';
- FstClr := '@00@';
- AltClr := '@00@';
- BBSName := ' List of BBSes';
- If ParamCount = 0 then CfgFileName := 'SYSOP.CFG'
- else Begin
- TmpStr := ParamStr(1);
- For I:= 0 to Length(TmpStr) do CfgFileName[I] := Upcase(TmpStr[I]);
- End;
- Assign(CfgFile,CfgFileName);
- {$I-}
- Reset(CfgFile);
- {$I+}
- If IOResult <> 0 then
- Begin
- Writeln(CfgFileName,' does not exist.');
- Halt;
- End;
- Readln(CfgFile,TmpStr);
- For I := 1 to Length(TmpStr) do BBSName[I] := TmpStr[I];
- Readln(CfgFile,TmpStr);
- For I := 0 to Length(TmpStr) do InFileName[I] := Upcase(TmpStr[I]);
- Readln(CfgFile,TmpStr);
- For I := 0 to Length(TmpStr) do BBSFileName[I] := Upcase(TmpStr[I]);
- Readln(CfgFile,TmpStr);
- For I := 0 to Length(TmpStr) do OutFileName[I] := Upcase(TmpStr[I]);
- Readln(CfgFile,TmpStr);
- For I := 1 to 2 do LineClr[I+1] := Upcase(TmpStr[I]);
- Readln(CfgFile,TmpStr);
- For I := 1 to 2 do NameClr[I+1] := Upcase(TmpStr[I]);
- Readln(CfgFile,TmpStr);
- For I := 1 to 2 do FlagClr[I+1] := Upcase(TmpStr[I]);
- Readln(CfgFile,TmpStr);
- For I := 1 to 2 do TitleClr[I+1] := Upcase(TmpStr[I]);
- Readln(CfgFile,TmpStr);
- For I := 1 to 2 do FstClr[I+1] := Upcase(TmpStr[I]);
- Readln(CfgFile,TmpStr);
- For I := 1 to 2 do AltClr[I+1] := Upcase(TmpStr[I]);
- Close(CfgFile);
- End;
-
- (******************)
- Procedure ChkInFile;
-
- Begin
- Assign(InFile,InFileName);
- {$I-}
- Reset(InFile);
- {$I+}
- If IOResult <> 0 then
- Begin
- Writeln(InFileName,' does not exist.');
- Halt;
- End;
- End;
-
- (******************)
- Procedure BBSGen;
-
- Var
- BBSStr : String;
- Toggle : Boolean;
-
- Begin
- Toggle := False;
- Assign(BBSFile,BBSFileName);
- Rewrite(BBSFile);
- Writeln(BBSFile,'@CLS@',LineClr,Line);
- Writeln(BBSFile,NameClr,BBSName);
- Writeln(BBSFile,LineClr,Line);
- Writeln(BBSFile);
- Writeln(BBSFile,FlagClr,'Flags: R = Offline Reader G = Games F = Files A = Adults');
- Writeln(BBSFile);
- Writeln(BBSFile,TitleClr,'BBS Name Phone # Software Baud R G F A');
- Writeln(BBSFile);
- Reset(InFile);
- While NOT EOF(InFile) do
- Begin
- BBSStr := BBSLine;
- For I := 1 to 5 do Readln(InFile);
- Readln(InFile,TmpStr);
- If TmpStr[12] = 'Y' then
- Begin
- Readln(InFile,TmpStr);
- For I := 1 to (Length(TmpStr)-10) do BBSStr[I] := TmpStr[I+10];
- Readln(InFile,TmpStr);
- For I := 1 to (Length(TmpStr)-10) do BBSStr[I+26] := TmpStr[I+10];
- Readln(InFile,TmpStr);
- For I := 1 to (Length(TmpStr)-10) do BBSStr[I+40] := TmpStr[I+10];
- Readln(InFile,TmpStr);
- For I := 1 to (Length(TmpStr)-10) do BBSStr[I+60] := TmpStr[I+10];
- Readln(InFile,TmpStr);
- BBSStr[68] := TmpStr[11];
- Readln(InFile,TmpStr);
- BBSStr[71] := TmpStr[11];
- Readln(InFile,TmpStr);
- BBSStr[74] := TmpStr[11];
- Readln(InFile,TmpStr);
- BBSStr[77] := TmpStr[11];
- If Toggle then
- Begin
- Writeln(BBSFile,AltClr,BBSStr);
- Toggle := False;
- End
- else Begin
- Writeln(BBSFile,FstClr,BBSStr);
- Toggle := True;
- End;
- Readln(InFile);
- End;
- End;
- Writeln(BBSFile,'@PAUSE@');
- Writeln(BBSFile,LineClr,Line);
- Writeln(BBSFile,NameClr,' SysOps, fill out the questionaire at the Main Menu to add your system.');
- Writeln(BBSFile,LineClr,Line);
- Writeln(BBSFile,NameClr,' Product of Worst Knightmare Software');
- Writeln(BBSFile,LineClr,Line);
- Close(BBSFile);
- End;
-
- (******************)
- Procedure TXTGen;
-
- Var
- BBSStr : String;
-
- Begin
- Assign(TXTFile,OutFileName);
- Rewrite(TXTFile);
- Writeln(TXTFile,Line);
- Writeln(TXTFile,BBSName);
- Writeln(TXTFile,Line);
- Writeln(TXTFile);
- Writeln(TXTFile,'Flags: R = Offline Reader G = Games F = Files A = Adults');
- Writeln(TXTFile);
- Writeln(TXTFile,'BBS Name Phone # Software Baud R G F A');
- Writeln(TXTFile);
- Reset(InFile);
- While NOT EOF(InFile) do
- Begin
- BBSStr := BBSLine;
- For I := 1 to 5 do Readln(InFile);
- Readln(InFile,TmpStr);
- If TmpStr[12] = 'Y' then
- Begin
- Readln(InFile,TmpStr);
- For I := 1 to (Length(TmpStr)-10) do BBSStr[I] := TmpStr[I+10];
- Readln(InFile,TmpStr);
- For I := 1 to (Length(TmpStr)-10) do BBSStr[I+26] := TmpStr[I+10];
- Readln(InFile,TmpStr);
- For I := 1 to (Length(TmpStr)-10) do BBSStr[I+40] := TmpStr[I+10];
- Readln(InFile,TmpStr);
- For I := 1 to (Length(TmpStr)-10) do BBSStr[I+60] := TmpStr[I+10];
- Readln(InFile,TmpStr);
- BBSStr[68] := TmpStr[11];
- Readln(InFile,TmpStr);
- BBSStr[71] := TmpStr[11];
- Readln(InFile,TmpStr);
- BBSStr[74] := TmpStr[11];
- Readln(InFile,TmpStr);
- BBSStr[77] := TmpStr[11];
- Writeln(TXTFile,BBSStr);
- Readln(InFile);
- End;
- End;
- Writeln(TXTFile,Line);
- Writeln(TXTFile,' SysOps, fill out the questionaire at the Main Menu to add your system.');
- Writeln(TXTFile,Line);
- Writeln(TXTFile,' Product of Worst Knightmare Software');
- Writeln(TxtFile,Line);
- Close(TXTFile);
- End;
-
- (******************)
- (******************)
- (****** Main ******)
- (******************)
- (******************)
- Begin
- ClrScr;
- Config;
- ChkInFile;
- If BBSFileName <> 'N' then BBSGen;
- If OutFileName <> 'N' then TXTGen;
- Close(InFile);
- End.